package com.oak.designmode._01_factoryPattern.abstractFactory;

/**
 * 抽象工厂模式
 * 围绕一个超级工厂（IceCreamFactory）来创建其他厂（BigIceCream、SmallIceCream）
 *
 * @ClassName: FactoryTest
 * @Description  三种口味的冰淇淋，分为大份、小份生产
 * @Author guoxy
 * @Date 2019/12/4
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {

        //生产苹果味冰激凌
        IceCreamFactory appleIceCreamFactory = new AppleIceCreamFactory();
        BigIceCream appleBigIceCream = appleIceCreamFactory.createBigIceCream();
        SmallIceCream appleSmallIceCream = appleIceCreamFactory.createSmallIceCream();
        appleBigIceCream.taste();
        appleSmallIceCream.taste();

        //生产香蕉味冰激凌
        IceCreamFactory bananaIceCreamFactory = new BananaIceCreamFactory();
        BigIceCream bananaBigIceCream = bananaIceCreamFactory.createBigIceCream();
        SmallIceCream bananaSmallIceCream = bananaIceCreamFactory.createSmallIceCream();
        bananaBigIceCream.taste();
        bananaSmallIceCream.taste();

        //生产橘子味冰激凌
        IceCreamFactory orangeIceCreamFactory = new OrangeIceCreamFactory();
        BigIceCream orangeBigIceCream = orangeIceCreamFactory.createBigIceCream();
        SmallIceCream orangeSmallIceCream = orangeIceCreamFactory.createSmallIceCream();
        orangeBigIceCream.taste();
        orangeSmallIceCream.taste();
    }
}
